<?php
namespace Home\Controller;
use Think\Controller;
class TaskController extends Controller {
    /*
     * curl_post 父类Controller的curl方法
     * */
    /*流程任务提交功能首页*/
    public function index(){
        //$this->curl_post();
        $result = M('task')->where()->find();
        $this->display();
    }

   /* 前往   对应客户身份上传操作*/
    
    public function idsub(){
        $img = $this->doupimgs();//图片上传 返回路径
        $data = I('post.');//taskid clientid 
        $data['img'] = $img;
        $info[]= '';//图片识别的信息
        if(){
           echo json_encode(array('status'=>0,'msg'=>'识别失败')); 
        }
        $data['name'] = $info['name'];
        $data['idnum'] = $info['idnum'];
        $data['sex'] = $info['sex'];
        $data['birth'] = $info['birth'];
        $data['native'] = $info['native'];
        $data['time'] = date('Y/m/d H:i:s',time());
        //$data['protrait'] = 从身份证识别的肖像

        $m = M('check');
        $add_result = $m->add($data);
        if($add_result){
            echo json_encode(array('status'=>1,'msg'=>'识别成功'));
        }else {
            echo json_encode(array('status'=>0,'msg'=>'识别失败'));
        }


    }
/*对应 客户签名上传操作*/





    /*返程执行更新操作*/
    public function sub(){
        $image = $this->doupimgs();//路径
        $data = I('post.');//
        $data['img'] = $image;
        $m = M('upload');
        $map['id'] = $data['id'];
        /*先添加上传记录后更新原始任务记录表*/
        $add_result = $m->add($data);
        $update_result = $m->where($map)->save($data);
        if($update_result){
            echo json_encode(array('status'=>1,'msg'=>'添加成功'));
        }
    }

    


}